import 'package:flutter/material.dart';

class FocusInfos extends StatefulWidget{
  @override
  _FocusInfosState createState()=>_FocusInfosState();

}
class _FocusInfosState extends State<FocusInfos> with AutomaticKeepAliveClientMixin
{
  int count=0;
  void add(){
    setState((){
      count++;
    });
  }
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      body: Center(
        child: Text('focus:$count',style: TextStyle(fontSize: 30)),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: add,
        child: Icon(Icons.add),
      ),
    );
  }
@override
void initState() {
    // TODO: implement initState
    super.initState();
    print('focus initState');
  }
  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive => true;
}